<!--
 描述: 教学院长学期报告
 作者: Hanyue
 日期: 2020-06-20
-->

<template>
  <div class="home-container">
  	<div class="wrap" ref="wrap" :style="{height:fullHeight+'px'}">
      <div class="top" ref="top">{{title}}</div>
      <div class="tab" ref="tabH">
        <a v-for="(item,index) in bylist" :key="index"  href="#" :class="curTab == index ? 'active':''" @click="change(index)"><span>{{item.name}}</span></a>
      </div>
      <el-row :gutter="20" ref="editor" >
        <el-col :span="8" :style="{height:(fullHeight - otherH)+'px'}">
          <jxyxPart />
        </el-col>
        <el-col :span="8" :style="{height:(fullHeight - otherH)+'px'}">
          <xuejiPart />
        </el-col>
        <el-col :span="8">
          <el-row :gutter="20">
            <el-col :span="24" :style="{height:(fullHeight - otherH - 20)/2 +'px'}" style="margin-bottom:20px;">
              <kscjPart />
            </el-col>
            <el-col :span="24" :style="{height:(fullHeight - otherH - 20)/2 +'px'}">
              <byxwPart />
            </el-col>
          </el-row>
        </el-col>
      </el-row>
  

    </div>
    
  </div>
</template>

<script>

export default {
  name: 'xueqibg',
  data() {
  	return {
      title:'教学院长学期报告',
  		bylist:[
        {id:0, name:'本科生'},
        {id:1, name:'研究生'},
      ],
      curTab:0,
      fullHeight:0,
      otherH:0
  	}
  },
  computed: {

  },
  created() {
  },
  mounted() {
    // screenSize(this.$refs.editor);
    let self = this;
    this.curTab = 0;
    this.handleResize();
    window.addEventListener('resize', self.handleResize);
    this.$once('hook:beforeDestroy', () => {
      window.removeEventListener('resize', self.handleResize);
    });
  },
  methods: {
    change(index){
      this.curTab = index;
    },
    handleResize(){
      this.$setFontSize();
      this.fullHeight = this.$setHeight().screenHeight;
      let topH = this.$refs.top.offsetHeight;
      let tabH = this.$refs.tabH.offsetHeight;
      this.otherH = topH + tabH + 30;
    }
  
  }
}
</script>

<style lang="scss" scoped>
.tab{
  text-align: left;
  padding-left:5rem;
  margin-bottom:1rem;
  a{
    display: inline-block;
    width: 10rem;
    height: 2.8rem;
    line-height: 2.85rem;
    position: relative;
    text-align: center;
    margin-right:1rem;
    font-size:1rem;
    color:#fff;
    z-index: 1;
    span{
      position: relative;
      z-index: 2;
    }
    &::after, &.active::after{
      content:'';
      position: absolute;
      top:0;
      left:0;
      width:100%;
      height:100%;
      border:1px solid #474990;
      transform: skewX(-30deg);
      z-index: 0;
    }
    &:hover{
      &::after{
      background:none;
      border:1px solid #676ab9;
      }
    }
    &.active{
      &::after{
      background:linear-gradient(to right, #456499 ,#71b2e6)
      }
    }
   
  }
}

.home-container {
	position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  .wrap {
    transform-origin: 0px 0px 0px;
    background: url(../../assets/img/jxbg_bg.jpg) no-repeat;
    background-size: cover;
    background-position: 50% 0;
    background-color: rgb(0, 0, 0);
    min-width: auto;
    width: 100%;
    min-height: auto;
    overflow: auto;
    .el-row{
      margin:0!important;
    }
    .el-col .el-row{
      margin:0 -10px !important;
    }
    .top {
      width: 100%; 
      height: 5rem; 
      line-height: 2;
      background-color: transparent; 
      background: url(../../assets/img/jxbg_title.png) no-repeat center; 
      background-size: contain;
      border: none; 
      overflow: hidden;
      text-align: center;
      color:#fff;
      font-size:2rem;
      letter-spacing: 1px;
      padding-left:2px;
      margin-top: .5rem;
    }


  }
}	
</style>
